/**
** @author cjd  
* @date 2018年5月24日  
* @version 1.0  
 */
package com.openvas.core.gas.config;

import java.nio.charset.Charset;
import java.util.Base64;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpHeaders;
import org.springframework.web.client.RestTemplate;

/**
 * @author Cocnet
 *
 */
@Configuration
public class RestConfig {

	@Bean
	public RestTemplate getResTemplate(){
		
		return new RestTemplate();
		
	}
	@Bean
	public HttpHeaders getHeaders(){
		HttpHeaders headers=new HttpHeaders();
		String auth="c51899158bceddc342df97ca:b5497b131af51b1cb52c4672";
		byte[] encodeAuth=Base64.getEncoder().encode(auth.getBytes(Charset.forName("UTF-8")));
		String authHeader ="Basic "+new String(encodeAuth);
		headers.set("Authorization", authHeader);
		return headers;


	}


	
}
